﻿<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Pragma" content="no-cache">
<meta name="GENERATOR" content="Microsoft FrontPage 12.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="STYLESHEET" type="text/css" href="../inc/editor.css">
<title>WebNoteEditor</title>
<link rel="STYLESHEET" type="text/css" href="../inc/editor.css">
<style>
.Preview{width:600;height:500;zoom:18.75%;z-index:-1;position:relative}
p{margin-top:1;margin-bottom:1}
*{font-size:9pt}
div.border{border: 1 solid #000000;margin-top:5;margin-left:5;margin-right:5;margin-bottom:2;cursor:hand}

A:visited {COLOR: #0000FF; TEXT-DECORATION: none;cursor:hand;font-size:9pt}
A:active {COLOR: #FF6600;TEXT-DECORATION: none;cursor:hand;font-size:9pt}
A:link {COLOR: #0000FF; TEXT-DECORATION: none;cursor:hand;font-size:9pt}
a:hover      { text-decoration: underline; cursor: hand; font-size: 9pt; color: #FF6600}
</style>
<script language="vbscript" src="../script/window.vbs"></script>
<Script Language="vbscript">
Dim webTPLBasePath
dim TPLCount
dim srcObject
webTPLBasePath="../WebTPL/"

Sub ShowAllTPL()
	dim i,j,mmStep
	TPLCount=10
	mmStep=4
	Document.writeln "<table align='center'>"
		For i=1 to TPLCount step mmStep
			Document.writeln "<tr>"
			For j=0 to mmStep-1
				if i+j>TPLCount then
					Exit For
				end if
				Document.writeln "<td width=''><div class='border'><iframe ID='TPL"&i+j&"' src='"&webTPLBasePath&"TPL"&i+j&".htm' Class='Preview' frameborder='0' scrolling='no'></iframe></div><p align='center'><a id='txt"&i+j&"' href='#'></a></p></td>"
			Next
			Document.writeln "<tr>"
		Next
	Document.writeln "</table>"
End Sub

Sub ShowTPLTitle()
	dim i,tempObj
	For i=1 to TPLCount
		Set tempObj=Document.getElementByID("txt"&i)
		With tempObj
			.innerHTML=document.Frames("TPL"&i).Document.title
			'.href="#"
			.title="使用模板【"&.innerText&"】"
			.parentElement.setAttribute "WebNote_Index",i
			.onclick=getRef("SelectWebTPL")
		End With
	Next
End Sub

Sub SelectWebTPL()
	dim sIndex
	'msgbox window.event.srcElement.parentElement
	sIndex=window.event.srcElement.parentElement.getAttribute("WebNote_Index")
	'srcObject.frames("EditContent").location=Document.getElementByID("TPL"&sIndex).src
	For Each it in Document.Frames("TPL"&sIndex).Document.getElementsByTagName("img")
		it.src=it.src
	Next
	srcObject.setData Document.Frames("TPL"&sIndex).Document.body.innerHTML
	

	srcObject.ShowTableGuide
	window.close
	
End Sub

Sub Window_onload()
	set srcObject=window.dialogArguments
	Call ShowTPLTitle()
	Call AutoResizeDialogWindow
End Sub

</Script>
</head>

<body>
<Script language="vbscript">
Call ShowAllTPL
</Script>

</body>

</html>
